﻿CREATE TABLE [enterprise].[Person] (
    [Id]             INT            IDENTITY (1, 1) NOT NULL,
    [Name]           NVARCHAR (128) NOT NULL,
    [Surname]        NVARCHAR (128) NOT NULL,
    [IdentityNumber] CHAR (11)      NOT NULL,
    [UserId]         INT            NULL,
    CONSTRAINT [PK_Person] PRIMARY KEY CLUSTERED ([Id] ASC),
    CONSTRAINT [FK_Person_User] FOREIGN KEY ([UserId]) REFERENCES [framework].[User] ([Id]),
    CONSTRAINT [AK_Person_Identity] UNIQUE NONCLUSTERED ([IdentityNumber] ASC)
);



